package unit_5;
import java.util.Arrays;
public class Demo07 {
    public static int[] arrayMerge(int[] a, int[] b){
        int[] result = new int[a.length + b.length];
        for(int i = 0; i < a.length; i++){
            result[i] = a[i];
        }
        for(int i = a.length; i < result.length; i++){
            result[i] = b[i - a.length];
        }
        Arrays.sort(result);
        return result;
    }

    public static void main(String[] args) {
        int[] a = {16, 13, 15, 18};
        int[] b = {29, 36, 100,9};
        int[] result = arrayMerge(a, b);
        for(int i : result){
            System.out.print(i + " ");
        }
    }
}
